package com.web.utils;

import java.util.*;

public class SingletonData {

	public static final String SEPARATOR_1 = "##";

	public static final String SEPARATOR_2 = "%%";

	private Integer key;

	private Map<Integer, String> data = new HashMap<Integer, String>();

	public Integer getKey() {
		return key;
	}

	public String getValue(Integer id) {
		return data.get(id);
	}

	public Integer setValue(String value) {
		Integer nextKey = nextKey();
		data.put(nextKey, value);
		return nextKey;
	}

	private Integer nextKey() {
		key = key != null ? key + 1 : 1;
		return key;
	}

}